<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=640,target-densitydpi=320,user-scalable=1">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="<?=base_url()?>public/css/m.css"/>
<script type="text/javascript" src="<?=base_url()?>public/js/jq.1.12.4.js"></script>
</head>
<body>
<div class="topp">得道天合</div>
<div  class="ying">
<?php echo form_open('mobile/login/info_post',array('id'=>'myform')); ?>
         <ul class="denglu">
		   	<li><span>公益账号</span><input type="text" value="" name="user_account" id="user_account"/></li>
		   	<li><span>账号密码</span><input type="password" value="" name="pwd" id="pwd"/></li>
		 	<li>
				<span>验 证 码</span>
				<input style="width:80px;" id="input1" type='text'>
				<input type="text" style="width:70px;margin-left:10px;font-size:16px;letter-spacing:4px;" readonly="readonly" id="checkCode" class="unchanged" />
			</li>
		   	<li><input id="btn_login" name="" type="submit" class="dlbut" value=""/></li>
		   	<li><a href="reg" class="ljzc">立即注册</a> <a href="forget" class="zhmmm">找回密码</a></li>
		 </ul>
</form>
</div>
<div class="deedt"></div>
</body>
<script language="javascript" type="text/javascript">
$(function(){
	var code ; //在全局 定义验证码
	function createCode(){
		code = "";
		var codeLength = 4;//验证码的长度
		var checkCode = document.getElementById("checkCode");
		var selectChar = new Array(0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');//所有候选组成验证码的字符，当然也可以用中文的
		for(var i=0;i < codeLength;i++){
			var charIndex = Math.floor(Math.random()*36);
			code +=selectChar[charIndex];
		}
		if(checkCode){
			checkCode.className="code";
			checkCode.value = code;
		}
	}
	createCode()
	$('#checkCode').on('click',createCode);
	$(document).on('submit','form',function () {
		if($('#user_account').val()=='' || $('#pwd').val() == ''){
			alert('请输入用户或密码');
			return false;
		}
		var inputCode = document.getElementById("input1").value;
		if(inputCode.length <=0){
			alert("请输入验证码！");
			return false;
		}else if(inputCode != code ){
			alert("验证码输入错误！");
			createCode();//刷新验证码
			return false;
		}
		return true;
		$('#myform').submit();
	});
});
</script>
</html>